package net.hn.hnms.biz.material.request;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Author: ly
 * 物资台账表
 */
@Data
@ApiModel("物资台账表")
public class MaterialRecordReq extends BaseReq {
    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.ASSIGN_UUID)
    private String recordId;
    @ApiModelProperty(value = "单证编号")
    @Length(max = 255, message = "单证编号长度不能超过255个字符")
    @NotBlank(message = "单证编号不能为空")
    private String recordCode;
    @ApiModelProperty(value = "单证类别")
    @NotBlank(message = "单证类别不能为空")
    private String recordType;
    @ApiModelProperty(value = "物资编码")
    @Length(max = 100, message = "物资编码长度不能超过100个字符")
    @NotBlank(message = "物资编码不能为空")
    private String materialCode;
    @ApiModelProperty(value = "物资名称")
    @Length(max = 100, message = "物资名称长度不能超过100个字符")
    @NotBlank(message = "物资名称不能为空")
    private String materialName;
    @ApiModelProperty(value = "规格型号")
    @Length(max = 100, message = "规格型号长度不能超过100个字符")
    @NotBlank(message = "规格型号不能为空")
    private String specificationModel;
    @ApiModelProperty(value = "所属仓库")
    @Length(max = 100, message = "所属仓库长度不能超过100个字符")
    @NotBlank(message = "所属仓库不能为空")
    private String warehouse;
    @ApiModelProperty(value = "单价")
    @Digits(integer = 0, fraction = 2, message = "单价格式不正确")
    @DecimalMin(value = "0.00", message = "单价格式不正确")
    @NotNull(message = "单价不能为空")
    private BigDecimal unitPrice;
    @ApiModelProperty(value = "数量")
    private Integer quantity;
    @ApiModelProperty(value = "单位")
    @Length(max = 100, message = "单位长度不能超过100个字符")
    @NotBlank(message = "单位不能为空")
    private String unit;
    @ApiModelProperty(value = "金额")
    @Digits(integer = 0, fraction = 2, message = "金额格式不正确")
    @DecimalMin(value = "0.00", message = "金额格式不正确")
    @NotNull(message = "金额不能为空")
    private BigDecimal amount;
    @ApiModelProperty(value = "库存单价")
    @Digits(integer = 0, fraction = 2, message = "库存单价格式不正确")
    @DecimalMin(value = "0.00", message = "库存单价格式不正确")
    @NotNull(message = "库存单价不能为空")
    private BigDecimal stockUnitPrice;
    @ApiModelProperty(value = "库存余量")
    private Integer stockQuantity;
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @NotNull(message = "创建时间不能为空")
    private Date createTime;
    @ApiModelProperty(value = "操作人ID")
    @Length(max = 100, message = "操作人ID长度不能超过100个字符")
    @NotBlank(message = "操作人ID不能为空")
    private String createPersonId;
    @ApiModelProperty(value = "操作人")
    @Length(max = 100, message = "操作人长度不能超过100个字符")
    @NotBlank(message = "操作人不能为空")
    private String createPerson;
    @ApiModelProperty(value = "供应商")
    @Length(max = 100, message = "供应商长度不能超过100个字符")
    @NotBlank(message = "供应商不能为空")
    private String supplier;
    @ApiModelProperty(value = "合同编号")
    @Length(max = 100, message = "合同编号长度不能超过100个字符")
    @NotBlank(message = "合同编号不能为空")
    private String contractCode;
    @ApiModelProperty(value = "删除标识 0正常 1删除")
    @NotBlank(message = "删除标识 0正常 1删除不能为空")
    private String delFlag;
    @ApiModelProperty(value = "库存余额")
    @Digits(integer = 0, fraction = 2, message = "库存余额格式不正确")
    @DecimalMin(value = "0.00", message = "库存余额格式不正确")
    @NotNull(message = "库存余额不能为空")
    private BigDecimal storeAmount;
    @ApiModelProperty(value = "矿编码")
    @Length(max = 100, message = "矿编码长度不能超过100个字符")
    @NotBlank(message = "矿编码不能为空")
    private String mineCode;
    @ApiModelProperty(value = "矿名称")
    @Length(max = 100, message = "矿名称长度不能超过100个字符")
    @NotBlank(message = "矿名称不能为空")
    private String mineName;
}









